/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package entityBeans;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author allankv
 */
@Entity
@Table(name = "nomenclaturalcode")
@NamedQueries({
    @NamedQuery(name = "Nomenclaturalcode.findAll", query = "SELECT n FROM Nomenclaturalcode n"),
    @NamedQuery(name = "Nomenclaturalcode.findByIdnomenclaturalcode", query = "SELECT n FROM Nomenclaturalcode n WHERE n.idnomenclaturalcode = :idnomenclaturalcode"),
    @NamedQuery(name = "Nomenclaturalcode.findByNomenclaturalcode", query = "SELECT n FROM Nomenclaturalcode n WHERE n.nomenclaturalcode = :nomenclaturalcode")})
public class Nomenclaturalcode implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "idnomenclaturalcode")
    private Integer idnomenclaturalcode;
    @Basic(optional = false)
    @Column(name = "nomenclaturalcode")
    private String nomenclaturalcode;
    @OneToMany(mappedBy = "nomenclaturalcode", fetch = FetchType.LAZY)
    private List<Taxonomicelement> taxonomicelementList;

    public Nomenclaturalcode() {
    }

    public Nomenclaturalcode(Integer idnomenclaturalcode) {
        this.idnomenclaturalcode = idnomenclaturalcode;
    }

    public Nomenclaturalcode(Integer idnomenclaturalcode, String nomenclaturalcode) {
        this.idnomenclaturalcode = idnomenclaturalcode;
        this.nomenclaturalcode = nomenclaturalcode;
    }

    public Integer getIdnomenclaturalcode() {
        return idnomenclaturalcode;
    }

    public void setIdnomenclaturalcode(Integer idnomenclaturalcode) {
        this.idnomenclaturalcode = idnomenclaturalcode;
    }

    public String getNomenclaturalcode() {
        return nomenclaturalcode;
    }

    public void setNomenclaturalcode(String nomenclaturalcode) {
        this.nomenclaturalcode = nomenclaturalcode;
    }

    public List<Taxonomicelement> getTaxonomicelementList() {
        return taxonomicelementList;
    }

    public void setTaxonomicelementList(List<Taxonomicelement> taxonomicelementList) {
        this.taxonomicelementList = taxonomicelementList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idnomenclaturalcode != null ? idnomenclaturalcode.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Nomenclaturalcode)) {
            return false;
        }
        Nomenclaturalcode other = (Nomenclaturalcode) object;
        if ((this.idnomenclaturalcode == null && other.idnomenclaturalcode != null) || (this.idnomenclaturalcode != null && !this.idnomenclaturalcode.equals(other.idnomenclaturalcode))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entityBeans.Nomenclaturalcode[idnomenclaturalcode=" + idnomenclaturalcode + "]";
    }

}
